package _1023.emp;

import static org.junit.Assert.*;

import java.sql.Date;
import java.sql.SQLException;

import org.junit.Test;

public class EmpDaoImplTest {

	EmpDao dao = new EmpDaoImpl();
	
	@Test
	public void testInsert() throws SQLException {
		boolean insert = dao.insert(new Emp(9999,"zs","clerk",7839, new Date(229187329173L),10,2000,20));
		System.out.println(insert);
	}

	@Test
	public void testUpdate() throws SQLException {
		boolean up = dao.update(new Emp(9999,"zhangsan","clerk",7839, new Date(229187329173L),1000,200,30));
		System.out.println(up);
	}

	@Test
	public void testDelete() throws SQLException {
		dao.delete(9999);
	}

	@Test
	public void testSelectById() throws SQLException {
		Emp emp = dao.selectById(7788);
		System.out.println(emp);
	}

	@Test
	public void testSelectByName() throws SQLException {
		dao.selectByName("a").forEach(System.out::println);
	}

	@Test
	public void testSelectByPage() throws SQLException {
		dao.selectByPage(2, 5).forEach(System.out::println);
	}

	@Test
	public void testSelectAll() throws SQLException {
		dao.selectAll().forEach(System.out::println);
	}

}
